<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/metadata/templateField/save}" >
        <input type="hidden" name="id" th:if="${metadataFieldDO}" th:value="${metadataFieldDO.id}">

        <div class="layui-form-item">
            <label class="layui-form-label required">选择模板</label>
            <div class="layui-input-inline">
                <select th:if="${metadataTemplates}" name="query" mo:list="${metadataTemplates}"
                        mo-selected="${metadataFieldDO?.metadataTemplate?.id}" mo-empty="" lay-verify="entity-type"></select>
            </div>
            <div class="layui-form-mid layui-word-aux">所属于的模板内容</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label required">字段名</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="name" placeholder="请输入字段名" th:value="${metadataFieldDO?.name}">
            </div>
            <div class="layui-form-mid layui-word-aux">由字母、数字、下划线组成，字段名</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">字段显示名</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="viewName" placeholder="请输入字段显示名" th:value="${metadataFieldDO?.viewName}">
            </div>
            <div class="layui-form-mid layui-word-aux">由合法字符组成，用于显示查看</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">字段类型</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="datatype" placeholder="请输入字段类型" th:value="${metadataFieldDO?.datatype}">
            </div>
            <div class="layui-form-mid layui-word-aux">由 Select 选择</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">查询方式</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="query" placeholder="请输入字段的查询方式" th:value="${metadataFieldDO?.query}">
            </div>
            <div class="layui-form-mid layui-word-aux">TODO 后续说明</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">显示</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="show" placeholder="请输入显示" th:value="${metadataFieldDO?.show}">
            </div>
            <div class="layui-form-mid layui-word-aux">TODO 后续说明</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">校验</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="verify" placeholder="请输入校验" th:value="${metadataFieldDO?.verify}">
            </div>
            <div class="layui-form-mid layui-word-aux">TODO 后续说明</div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${metadataFieldDO?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
</body>
</html>